package min.chapter.threeh;

import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ContainerClassAcquisition{
    public static void main(String[] args)
    {
        String[] parentConfigLocations = new String[]{"ContainerClassparent.xml"};
        AbstractApplicationContext parentContext = new ClassPathXmlApplicationContext(parentConfigLocations);
        String[] childConfigLocations  = new String[] {"ContainerClassChild.xml"};
        AbstractApplicationContext childContext = new ClassPathXmlApplicationContext(childConfigLocations, parentContext);
        ContainerClass parentSender = parentContext.getBean("smsSender", ContainerClass.class);
        ContainerClass childSender = childContext.getBean("smsSender", ContainerClass.class);
        System.out.println("parentSender == childSender :::: " +(parentSender == childSender));
        ContainerClassSystemMonitor monitor = childContext.getBean("monitor", ContainerClassSystemMonitor.class);
        System.out.println(monitor);
                
    }
}
